package com.yanghui.lingYueBot.handler;

import com.yanghui.lingYueBot.LingYueStart;
import com.yanghui.lingYueBot.core.messageHandler.GroupMessageHandler;
import net.mamoe.mirai.event.events.MessageEvent;

public class AdministratorHandler {

    public static void administratorMessageHandle(MessageEvent event) {
        String messageContent = event.getMessage().contentToString();
        String[] split = messageContent.split(" ", 2);
        if (split[0].contains(":")) {
            LingYueStart.groupHandlerHashMap.get(
                    Long.parseLong(split[0].split(":")[1].trim())
            ).group.sendMessage(split[1]);
        } else {
            for (GroupMessageHandler handler : LingYueStart.groupHandlerHashMap.values()) {
                handler.group.sendMessage(split[1]);
            }
        }
    }
}
